package net.lzzy.practicesapi1;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author locker
 */
@Configuration
@EnableOpenApi
public class SwaggerConfig {
    private ApiInfo apiInfo(){
        return new ApiInfoBuilder()
                .title("Practices服务器文档")
                .description("本接口用于软件技术专业项目课程教学")
                .contact(new Contact("lzw","https://mooc1.chaoxing.com/mycourse/studentstudy?chapterId=800822705&courseId=238893993&clazzid=87209173&cpi=285819884&enc=e6e09c51fa41317831bf0c718068f134&mooc2=1&openc=7b14e260500c88f8cf085d173cd78118","1478673736@qq.com"))
                .version("v1.0")
                .build();
    };
    @Bean
    public Docket docket(){
        return new Docket(DocumentationType.OAS_30)
                .apiInfo(apiInfo())
                .enable(true)
                .select()
                .apis(RequestHandlerSelectors.basePackage("net.lzzy.practicesapi1.web"))
                .paths(PathSelectors.any())
                .build();
    }


}
